<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 预编译
        // 函数声明整体提升，变量  声明提升，不包含声明时的赋值

        test();
        function test() { 
            console.log('a');
        }
        

        console.log(a); // 输出undefined
        var a = 123;  //若注释本行，则会报错

    </script>
</body>
</html>